<%-- 
    Document   : newjsp
    Created on : 06-nov-2013, 0:21:05
    Author     : Rey
--%>
<%@page import="com.upao.util.DBCurso"%>
<%@page import="com.google.appengine.api.datastore.Entity"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String nombre_curso = request.getAttribute("nombreCurso").toString();
    String nombres = "";
    String ape_paterno = "";
    String ape_materno = "";
    String nombre_completo = "";
    String email = "reyann11@gmail.com";
    String url = "";
    Entity user = (Entity) request.getAttribute("user");
    if (user != null) {
        nombres = user.getProperty("nombres").toString();
        ape_paterno = user.getProperty("ape_paterno").toString();
        ape_materno = user.getProperty("ape_materno").toString();
    }
    Entity curso = DBCurso.getEntityCursoByNombre(nombre_curso);
    if (curso != null) {
        url = curso.getProperty("url").toString();
    }
    nombre_completo = nombres + " " + ape_paterno + " " + ape_materno;

%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="../../assets/ico/favicon.png">

        <title>UpaoCommons 1.0</title>

        <!-- Bootstrap core CSS -->
        <link href="../../dist/css/bootstrap.css" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="jumbotron.css" rel="stylesheet">

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="../../assets/js/html5shiv.js"></script>
          <script src="../../assets/js/respond.min.js"></script>
        <![endif]-->
        <script type="text/javascript" src="scripts/ddsmoothmenu.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
        <script>
            $(document).ready(function() {
                $("#datepicker").datepicker();
                $('#datepicker').datepicker('option', {dateFormat: 'dd/mm/yy'});
                // $("#startDate").datepicker({dateFormat: 'dd/mm/yy'});
            });
        </script>
    </head>

    <body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">UPAO COMMONS</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="../index.jsp">Inicio</a></li>
                        <li><a href="#about">Nosotros</a></li>
                        <li><a href="#contact">Contacto</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Servicios <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li class="dropdown-header">Nav header</li>
                                <li><a href="#">Separated link</a></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                    </ul>
                    <form class="navbar-form navbar-right" method="post" action="/user">
                        <div class="form-group">
                            <input type="text" readonly="" placeholder="Correo" value="Bienvenido(a): <%=nombres%>" class="form-control"/>
                        </div>
                        <input type="hidden" name="action" value="logOutUser"/>
                        <button type="submit" class="btn btn-success">Cerrar Sesión</button>
                    </form>
                </div><!--/.navbar-collapse -->
            </div>
        </div>

        <%--Cuerpo del formulario--%>
        <br>
        <br>
        <br>
        <br>
        <br>
        <div style="float: left;margin-left: 100px;width:150px" >
            <ul class="nav nav-pills nav-stacked">
                <li><a href="/curso?action=cambioPagina&nombres=<%=nombres%>&path=/JSP/DashBoard.jsp">Inicio</a></li>
                <li><a href="/curso?action=getAllCursos&nombres=<%=nombres%>">Cursos</a></li>
                <li><a href="#">Correo</a></li>
                <li><a href="/instructor?action=getAllInstructores&nombres=<%=nombres%>">Instructores</a></li>
                <li class="active"><a>Configuración</a></li>
                <li><a href="#">Ayuda</a></li>
            </ul>
        </div>
        <div class="jumbotron" style="float:left; width:850px; height: 730px; margin-left: 150px">
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">
                    <b>Gestión del curso: </b><%=nombre_curso%>
                </div>
                <div style="background-color: #ffffff;height: 350px;margin-left: 50px;margin-top: 20px">
                    <form method="post" action="/curso">
                        <table style="font-size: smaller">
                            <tr>
                                <th>
                                    <label>Nombre del curso</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <input readonly="" style="margin-left: 50px;width: 350px" type="text" class="form-control" id="name" value="<%=nombre_curso%>" name="nombre_curso"/>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>URL</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <input type="text" readonly="" style="margin-left: 50px;width: 350px" class="form-control" value="<%=url%>" name="url"/>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>Destinatario</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <input style="margin-left: 50px;width: 350px" type="text" class="form-control"  id="urlid" value="" name="name_d"/>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>EMail</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <input style="margin-left: 50px;width: 350px" type="text" class="form-control"  id="emailid" value="" name="email_d"/>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>Asunto</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <input style="margin-left: 50px;width: 350px" type="text" class="form-control"  id="asuntoid" value="" name="subject"/>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>Mensaje</label>
                                </th>
                                <th></th>
                                <td>:</td>
                                <td>
                                    <%-- <textarea  name="description" cols="40" rows="5"></textarea>--%>
                                    <textarea style="margin-left: 50px;width: 350px" type="text" class="form-control"  id="mensajeid" value="" name="description"></textarea>
                                </td>
                            </tr>

                        </table>
                        <input type="hidden" name="action" value="enviarMail"/>
                        <input type="hidden" name="name_r" value="<%=nombre_completo%>"/>
                        <input type="hidden" name="email_r" value="<%=email%>"/>
                        <input type="hidden" name="nombres" value="<%=nombres%>"/>
                        <input type="hidden" name="nombre_curso" value="<%=nombre_curso%>"/>
                        <center><input style="height: 40px;font-size: medium" class="btn btn-primary btn-success" type="submit" value="Guardar"/>
                        </center>
                    </form>                    
                </div>
            </div>
        </div>
    </body>
</html>